<template>
  <div class="reviews-row">
    <div class="reviews-head">
      <i class="icon-cilcle"></i>
      <span class="row-time">{{ filterDate(reviews.ctime) }}</span>
    </div>
    <div class="wrap-content">
      <expand :word="reviews.content" :key="reviews.id"></expand>
      <div
        class="reviews-pic-list"
        v-if="+reviews.type === 3 && reviews.img && reviews.img.length > 0"
      >
        <div class="reviews-pic" v-for="(item, index) in reviews.img" :key="index">
          <img :src="item.url" @click="openImg(reviews.img, index)" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import expand from '@/components/common/Expand.vue';
import reviewMixin from '../lib/reviewMixin.js';
export default {
  name: 'ReviewsRow',
  components: { expand },
  mixins: [reviewMixin],
  props: {
    reviews: {
      type: Object,
      default: () => ({}),
    },
    spDate: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="less" scoped>
.reviews-pic-list {
  margin-top: 0.16rem;
  height: 1.8rem;
  display: flex;
  .reviews-pic {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.08rem;
    overflow: hidden;
    margin-right: 0.16rem;
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
.card-bg {
  background: #ffffff;
  border-radius: 0.12rem;
  margin-top: 0.16rem;
  padding: 0 0.24rem 0;
}
.reviews-head {
  display: flex;
  height: 0.12rem;
  align-items: center;
  .icon-cilcle {
    width: 0.12rem;
    height: 0.12rem;
    background: #ff2436;
    margin-right: 0.22rem;
    border-radius: 50%;
    margin-left: -0.06rem;
  }
  span {
    height: 0.32rem;
    font-size: 0.24rem;
    color: rgba(0, 0, 0, 0.32);
    line-height: 0.32rem;
  }
}
.wrap-content {
  border-left: 1px dashed #f2f2f2;
  padding-left: 0.26rem;
  padding-top: 0.26rem;
  padding-bottom: 0.42rem;
}
.lecturer-info {
  height: 0.68rem;
  display: flex;
  align-items: center;
  .lecturer-pic {
    width: 0.68rem;
    height: 0.68rem;
    margin-right: 0.2rem;
    margin-left: 0.12rem;
  }
  .lecturer-name {
    height: 0.36rem;
    font-size: 0.28rem;
    color: rgba(0, 0, 0, 0.84);
    line-height: 0.36rem;
    font-weight: 500;
    margin-right: 0.08rem;
  }
  .lecturer-intro {
    height: 0.28rem;
    line-height: 0.28rem;
    font-size: 0.2rem;
    color: rgba(0, 0, 0, 0.5);
  }
}
</style>
